package com.deductive.web.disposition.sys;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.deductive.domain.sys.SysDictionary;
import com.deductive.service.sys.SysDictionaryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 字典.
 *
 * @author yexiaolong
 * @version 1.0
 * @since 2025/8/29
 */
@RestController
@RequestMapping("/dictionary")
@Api(tags = "业务字典")
public class DictionaryController {

    @Resource
    private SysDictionaryService sysDictionaryService;

    @GetMapping("/list")
    @ApiOperation("业务查询列表")
    public List<SysDictionary> list( SysDictionary dictionary) {
        LambdaQueryWrapper<SysDictionary> eq = new LambdaQueryWrapper<>();
        eq.eq(StringUtils.isNotBlank(dictionary.getType()),SysDictionary::getType,dictionary.getType());
        return sysDictionaryService.list(eq);
    }

}
